function validateEmail(email)
{
    var result=new Array();
    var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/;
    if(email.match(emailExp))
    {
        result[0]=true;
    }
    else
    {
        result[0]=false;
        result[1]="The email format is wrong.";
    }
    return result;
}
function validatePassword(password)
{
    var result=new Array();
    if(password.length<6)    
    {                    
        result[0]=false;
        result[1]="length of password must not be less than 6.";
    }
    else
    {
        result[0]=true;
    }
    return result;
}
function validateRePassword(password,rePassword)
{                
    var result=new Array();
    if(password != rePassword)       
    {
        result[0]=false;
        result[1]="Re-entered password dose not match with the original.";
    }
    else
    {
        result[0]=true;
    }
    return result;
}
function validateAnswer(answer)
{
    var result=new Array();
    if(answer.length<3)
    {
        result[0]=false;
        result[1]="length of answer must not be less than 3.";
    }
    else
    {
        result[0]=true;
    }
    return result;
}
function validateNickname(nickname)
{
    var result=new Array();
    if(nickname.length<3)
    {
        result[0]=false;
        result[1]="length of nickname must not be less than 3.";
    }
    else
    {
        result[0]=true;                    
    }
    return result;
}
